package com.xand.jsonrpc;

import com.google.gson.Gson;

import com.google.gson.annotations.Expose;

public class JSONGenericResponse {
	public static final String RESPONSE_OK 				= "200";
	
	public static final String RESPONSE_GENERIC_ERROR 	= "500";
	
	@Expose
	private String shortErrorMessage = "";
	
	@Expose
	private String longErrorMessage  = "";
	
	@Expose
	private String responseCode;
	
	@Expose
	private String res;
	
	public String getShortErrorMessage() {
		return shortErrorMessage;
	}

	public void setShortErrorMessage(String shortErrorMessage) {
		this.shortErrorMessage = shortErrorMessage;
	}

	public String getLongErrorMessage() {
		return longErrorMessage;
	}

	public void setLongErrorMessage(String longErrorMessage) {
		this.longErrorMessage = longErrorMessage;
	}

	public String getRes() {
		return res;
	}

	public void setRes(String res) {
		this.res = res;
	}

	public String getResponseCode() {
		return responseCode;
	}

	public void setResponseCode(String responseCode) {
		this.responseCode = responseCode;
	}

	public final Object getResponse(Class clazz) {
		Gson gson = new Gson();
		
		Object ret = gson.fromJson(res, clazz);
		
		return ret;
	}
}
